From 48c4b783db28b4102985c991b1082aed4f1511aa Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 9 Sep 2004 16:51:40 +0000 Subject: [PATCH] Add a stub for GPS_Serial_Close for Windows. Remove O_NDELAY from open flags for Unix to make Linux USB/tty system happier. --- gpsbabel/jeeps/gpsserial.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gpsbabel/jeeps/gpsserial.c b/gpsbabel/jeeps/gpsserial.c index d0aa4631e..b552ecf01 100644 --- a/gpsbabel/jeeps/gpsserial.c +++ b/gpsbabel/jeeps/gpsserial.c @@ -180,6 +180,11 @@ int32 GPS_Serial_Read(int32 ignored, void *ibuf, int size) return cnt; } +int32 GPS_Serial_Close(int32 fd, const char *port) +{ + return 1; +} + #else #include @@ -278,8 +283,13 @@ int32 GPS_Serial_Open(int32 *fd, const char *port) { struct termios tty; - - if((*fd = open(port, O_RDWR | O_NDELAY | O_NOCTTY))==-1) + /* + * This originally had O_NDELAY | O_NOCTTY in here, but this + * causes problems with Linux USB ttys (observed on PL2303 and MCT) + * and the rest of the code doesn't _REALLY_ handle the partial + * write/retry case anyway. - robertl + */ + if((*fd = open(port, O_RDWR))==-1) { perror("open"); GPS_Error("SERIAL: Cannot open serial port"); -- 2.30.2